import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;

import java.util.*;

public class Test {
    private static Object TreeMap;

    public static Map<String,Integer> countWord(String[] words){
        Map<String,Integer> map=new HashMap<>();
        for (String s:words ) {
            if(map.get(s)==null){
                map.put(s,1);
            }else{
                int val=map.get(s);
                map.put(s,val+1);
            }
        }
        return map;
    }

    public static void func(String s1, String s2){
        s1=s1.toUpperCase();
        s2=s2.toUpperCase();
        Set<Character> st=new HashSet<>();
        for (int i = 0; i < s2.length(); i++) {
            char ch=s2.charAt(i);
            st.add(ch);
        }
        Set<Character> broken=new HashSet<>();
        for (int i = 0; i < s1.length(); i++) {
            char ch=s1.charAt(i);
            if(!st.contains(ch)&&!broken.contains(ch)){
                broken.add(ch);
                System.out.println(ch);
            }
        }
    }
    public static void main(String[] args) {

    }
    public static void main9(String[] args) {
        String[] words={"hello","abc","def","this","that","this"};
        Map<String,Integer> map=countWord(words);
        Set<Map.Entry<String,Integer>> entrySet=map.entrySet();
        for(Map.Entry<String,Integer> s:entrySet){
            System.out.println("kew:"+s.getKey()+"    val:"+s.getValue());
        }
    }
    public static void main8(String[] args) {
        HashBuck hashBuck=new HashBuck();
        hashBuck.push(1,9);
        hashBuck.push(11,9);
        hashBuck.push(14,9);
        hashBuck.push(4,9);
        hashBuck.push(2,9);
        hashBuck.push(15,9);
        hashBuck.push(6,9);
        hashBuck.push(5,9);
    }
    public static void main7(String[] args) {
        Solution.isHappy(19);
    }
    public static void main6(String[] args) {
        int[] arr={1,2,3,4,1,2,3,4,5,6,77,89};
        HashSet<Integer> hashSet=new HashSet<>();
        for(int i=0;i< arr.length;i++){
            hashSet.add(arr[i]);
        }
        System.out.println(hashSet);
    }
    public static void main5(String[] args) {
        HashMap<String,Integer> hashMap=new HashMap<>();
        hashMap.put("abcd",3);
    }
    public static void main4(String[] args) {
        TreeSet<String> treeSet=new TreeSet<>();
        treeSet.add("abc");
        treeSet.add("def");

        Iterator<String> iterator=treeSet.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
    public static void main3(String[] args) {
        TreeMap<String,Integer> treeMap=new TreeMap<>();
        treeMap.put("abc",2);
        treeMap.put("world",2);
        Integer s=treeMap.get("world2");
        Integer s2=treeMap.getOrDefault("world",100);
        //treeMap.remove("abc");
        Set<String> set=treeMap.keySet();
        Collection<Integer> collection=treeMap.values();
        Set<Map.Entry<String,Integer>> set2=treeMap.entrySet();
        for(Map.Entry<String,Integer> entry:set2){
            System.out.print(entry.getKey());
            System.out.print(entry.getValue());
            System.out.println();

        }
        System.out.println(set2);
        System.out.println(collection);
        System.out.println(set);
        System.out.println(s2);
    }

    public static void main1(String[] args) {
        int[] arr= {1,2,3};
        Solution.duplicateZeros(arr);
    }
    public static void main2(String[] args) {
        BinarySearchTree bst = new BinarySearchTree();
        bst.insert(10);
        bst.insert(5);
        bst.insert(15);
        bst.insert(9);
        bst.insert(3);
        bst.insert(18);
        bst.remove(10);
        Object treeMap = TreeMap;


    }
}
